Lantern is a python module for a toolkit collection for data exploration from a variety of dataset to visualization.
In this post, I will walk through the followings:
lanternlantern can doLantern¶# !pip install pylantern
# !jupyter labextension install pylantern # for jupyter lab
import lantern as l
import matplotlib.pyplot as plt
%matplotlib inline
import cufflinks as cf
from plotly.offline import plot, download_plotlyjs, init_notebook_mode
cf.go_offline()
init_notebook_mode()
# people from Mimesis - Fake Data Generator
l.person()
# multiple records of person with locale
l.people(count=5, locale='en')
# Visualize people
people = l.people(count=50, locale='en')
people['gender'].value_counts().plot(kind='bar');
people['age'].hist();
people['occupation'].value_counts().plot(kind='bar');
people['university'].value_counts().plot(kind='bar');
# company
l.company()
# Multiple companies
l.companies(count=5)
# Visualize comapanies
companies = l.companies(count=50)
companies.columns.values
companies['exchange'].value_counts().plot(kind='bar');
companies['industry'].value_counts().plot(kind='bar');
[l.ticker(country='us') for i in range(10)]
[l.currency() for i in range(10)]
l.trades(count=5)
# Visualization
trades = l.trades(count=50)
trades['price'].hist(bins=50).plot();
trades['sector'].value_counts().plot(kind='bar');
### General Purpose
l.superstore(count=5)
# Visualization
superstore=l.superstore(count=50)
superstore['Country'].value_counts().plot(kind='bar');
superstore['Profit'].plot(kind='hist');
superstore['Sales'].plot(kind='hist');
superstore['State'].value_counts().plot(kind='bar');
l.area().head()
fig = l.area().iplot(kind='area', fill=True, asFigure=True)
# plot(fig, include_plotlyjs=False, output_type='div')
l.bar().head()
fig = l.bar().iplot(kind='bar', asFigure=True)
l.box().head()
fig = l.box().iplot(kind='box', asFigure=True)
# plot(fig, include_plotlyjs=False, output_type='div')